package pl.edu.agh.pros.proxy.logic.wrapper;

import java.io.Serializable;

import pl.edu.agh.pros.proxy.model.AppConfiguration;
import pl.edu.agh.pros.proxy.model.XmppServerConfiguration;

import com.google.appengine.api.datastore.Key;

public class AppConfigurationWrapper implements Serializable {

	private static final long serialVersionUID = 7173879528773066814L;

	private AppConfiguration appConfiguration;

	private XmppServerConfiguration xmppServerConfiguration;

	private String xmppServer;

	public AppConfigurationWrapper(AppConfiguration appConfiguration) {
		this.appConfiguration = appConfiguration;
	}

	public AppConfiguration getAppConfiguration() {
		return appConfiguration;
	}

	public Key getKey() {
		return appConfiguration.getKey();
	}

	public void setKey(Key key) {
		this.appConfiguration.setKey(key);
	}

	public Key getProviderKey() {
		return this.appConfiguration.getProviderKey();
	}

	public void setProviderKey(Key providerKey) {
		this.appConfiguration.setProviderKey(providerKey);
	}

	public String getName() {
		return this.appConfiguration.getName();
	}

	public void setName(String name) {
		this.appConfiguration.setName(name);
	}

	public String getProviderAppKey() {
		return this.appConfiguration.getProviderAppKey();
	}

	public void setProviderAppKey(String providerAppKey) {
		this.appConfiguration.setProviderAppKey(providerAppKey);
	}

	public String getClientAppKey() {
		return this.appConfiguration.getClientAppKey();
	}

	public void setClientAppKey(String clientAppKey) {
		this.appConfiguration.setClientAppKey(clientAppKey);
	}

	public XmppServerConfiguration getXmppServerConfiguration() {
		return xmppServerConfiguration;
	}

	public void setXmppServerConfiguration(XmppServerConfiguration xmppServerConfiguration) {
		if (xmppServerConfiguration != null) {
			this.xmppServerConfiguration = xmppServerConfiguration;
			this.appConfiguration.setXmppServerConfigurationKey(xmppServerConfiguration.getKey());
			this.xmppServer = xmppServerConfiguration.getHostname();
		}
	}

	public String getXmppServer() {
		return xmppServer;
	}

	public void setXmppServer(String xmppServer) {
		this.xmppServer = xmppServer;
	}

}
